package com.ruoyi.imweb.config;

import com.ruoyi.websocket.config.INettyConfig;
import com.ruoyi.websocket.entity.Pair;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;


@Data
@Configuration
@ConfigurationProperties(prefix = "netty-config")
public class ImNettyConfig implements INettyConfig {
    /**
     * boss线程组数量
     */
    private Integer bossGroupThreadNum = 5;
    /**
     * worker线程组数量
     */
    private Integer workerGroupThreadNum=0;

    /**
     * 配置ServerChannel选项参数，如：ChannelOption.SO_BACKLOG：
     */
    private List<Pair<String, String>> options=new ArrayList<>();
    /**
     * 配置客户端Channel参数，如：ChannelOption.SO_KEEPALIVE：
     */
    private List<Pair<String, String>> childOptions=new ArrayList<>();


    private Integer port;

    private Integer maxContentLength;

    private String websocketPath;
    private String userFlag;
    private Boolean enabledToken;

    private Long readerIdleTime=60L;
    private Long writerIdleTime=0L;
    private Boolean enabledTest=false;
}
